﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Payment.API.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Payment.API.Infrastructure.EntityConfigurations
{
    public class PaymentLogEntityTypeConfiguration
         : IEntityTypeConfiguration<PaymentLog>
    {
        public void Configure(EntityTypeBuilder<PaymentLog> builder)
        {
            builder.ToTable("PaymentLog");

            builder.HasKey(ci => ci.Id);

            builder.Property(ci => ci.Id)
              .UseHiLo("paymentlogseq")
              .IsRequired();

            builder.Property(cb => cb.OrderId)
                .IsRequired(true);
            builder.Property(cb => cb.Status)
                .IsRequired(true);
            builder.Property(cb => cb.CreateTime)
                .IsRequired(true);
            builder.Property(cb => cb.UserId)
                .IsRequired(true);
        }
    }
}
